<template>
	<view class="teach-container">
		<view class="detail">
			<view class="course" v-for="(item, index) in tableData" :key="index" @click="toDataCenter(item)">
				<view class="left">
					<image :src="item.imgUrl" mode="widthFix"></image>
				</view>
				<view class="center">
					<text class="name">{{item.activityName}}</text>
					<text>开始时间:{{parseTime(item.startTime,'{y}-{m}-{d} {h}:{i}')}}</text>
					<text>结束时间:{{parseTime(item.endTime,'{y}-{m}-{d} {h}:{i}')}}</text>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import { getAdminActivity} from '@/api/exam/activity.js'
	import {parseTime } from '@/utils/ruoyi'
	export default {
		data() {
			return {
				tableData: [],
				pageForm:{
					pageNo:1,
					pageSize:10,
				},
				parseTime,
			}
		},
		created() {
			this.getList();
		},
		methods: {
			getList(){
				getAdminActivity(this.pageForm).then(res=>{
					this.tableData=res.data.list
				})
			},

			toDataCenter(e){
				this.$tab.navigateTo('/pages/work/datacenter/index?activityId=' + e.id)
			}
		}
	}
</script>

<style lang="scss">
	/* #ifndef APP-NVUE */
	page{
		background: #fff;
	}
	view {
		font-size: 14px;
		line-height: inherit;
	}
	
	/* #endif */
	.teach-container{
		background-color: #fff;
		padding: 40rpx;
		.detail {
			width: 100%;
			background-color: #fff;
			border-radius: 20rpx;
			padding-top: 20rpx;
			.course{
				display: flex;
				border-bottom: 1px solid #EDEDED;
				padding: 10px 0;
				align-items: flex-end;
				text{
					line-height: 30px;
					font-size: 12px;
					font-family: Inter-Regular, Inter;
					font-weight: 400;
				}
				.left{
					width: 75px;
					height: 65px;
					overflow: hidden;
				}
				.center{
					width: 180px;
					padding-left: 20px;
					text{
						display: block;
						color: #508CFF;
					}
					.name{
						font-size: 14px;
						color: #000000;
					}
				}
			}
			
		}
	}
</style>